package ltd.newbee.mall.entity;

import lombok.*;
import org.hibernate.Hibernate;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;

/**
 * @ClassName: NewbeeMallSupplierInfo
 * @Description: 供货商信息
 * @Author: bwh
 * @Date: 2022/9/4 7:18
 * @Version 1.0
 */
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@Entity
public class NewbeeMallSupplierInfo {

    /**
     * 供货商ID
     */
    @Id
    private String supplierId;

    /**
     * 供货商名称
     */
    private String supplierName;

    /**
     * 地址
     */
    private String supplierAddress;

    /**
     * 供货商联系电话
     */
    private String supplierPhone;


    /**
     * 联系人姓名
     */
    private String contactName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
        NewbeeMallSupplierInfo that = (NewbeeMallSupplierInfo) o;
        return supplierId != null && Objects.equals(supplierId, that.supplierId);
    }

    @Override
    public int hashCode() {
        return getClass().hashCode();
    }
}
